﻿Public Class ven_pol2

    

    
    Private Sub btnok_ven_pol2_Click_1(sender As Object, e As EventArgs) Handles btnok_ven_pol2.Click
        yc2 = Convert.ToSingle(txtyc2_jp2.Text)
        fp12 = Convert.ToSingle(txt_fp12.Text)
        fp22 = Convert.ToSingle(txt_fp22.Text)
        dp12 = Convert.ToSingle(txt_dp12.Text)
        dp22 = Convert.ToSingle(txt_dp22.Text)
        tetap2 = Convert.ToSingle(txt_tetap2.Text)
        decp2 = Convert.ToSingle(txt_decp2.Text)

        tetap2 = tetap2 * (3.141592 / 180)
        alfap2 = Math.Asin((dp22 - dp12) / (2 * decp2))

        fxcp2 = -Math.Cos(alfap2) * (fp12 + fp22)
        fzcp2 = Math.Sin(alfap2) * (fp12 - fp22)

        fxp2 = fxcp2 * Math.Cos(tetap2) - fzcp2 * Math.Sin(tetap2)
        fzp2 = fxcp2 * Math.Sin(tetap2) + fzcp2 * Math.Cos(tetap2)

        c2x = fxp2
        c2y = 0
        c2z = fzp2
        m2x = 0
        m2y = -(fp12 + fp22) * dp12 * 0.5
        m2z = 0

        Me.Close()
    End Sub
End Class